<?php 
include 'includes.php';
include 'functions.php';
include 'config.php';
session_start();
print_header("Mercatino dei Libri Usati", false);
print_sidebar(false);
$db = new db();



if ( isset($_GET['subject']) ){
			$subject = $_GET['subject'] ;
			$random = FALSE;
			$sortby = "title";
			if ( isset($_GET['page']))
				$page = $_GET['page'];
			else $page = 1;
		}
		else{
			$subject = FALSE;
			$random = TRUE;
			$sortby = FALSE;
			$page = FALSE;
		}

		
		
		?>

<!--Main Content-->
	<div id="main-content" class="no-background shop">
		<?php
		
			
			
		print_books($subject , $sortby , $page, $random);?>
		
		
	</div>
	




<?php 
print_footer();
?>